package com.growthserver.mapper;

import com.growthserver.entity.*;
import com.growthserver.param.CommonParam;
import com.growthserver.param.IntegralParam;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

public interface AppletMapper {

    HashMap<String,String> getMemberLevelEnum();
    TMemberEntity selectMemberInfoByUserId(@Param("userId") String userId);

    void memberRegistration(@Param("userId") String userId,
                            @Param("userName") String userName,
                            @Param("levelNum") String levelNum,
                            @Param("levelName") String levelName,
                            @Param("memberId") String memberId);

    /**
     * 会员用户类型变更
     * @param userId
     * @param userType
     */
    void updateUserType(@Param("userId") String userId,@Param("userType") String userType);

    /**
     *
     * @param userId
     */
    void deleteMemberByUserId(@Param("userId") String userId);
    /**
     * 获取用户等级
     */
    TMemberEntity getUserLevel(String userId);

    /**
     * 根据用户ID查询用户等级
     * @param userIds
     * @return
     */
    List<HashMap<String,String>> getUserLevelList(@Param("userIds") List<String> userIds);

    /**
     * 获取用户等级对应信息
     * @param levelNum
     * @param userType
     * @return
     */
    HashMap<String,String> selectMemberLevelInfoByUserId(@Param("levelNum") String levelNum, @Param("userType") String userType);

    /**
     * 获取用户等级对应的最大成长值和最小成长值
     * @return
     */
    Object getUserLevelGrowth(@Param("levelNum") String levelNum,@Param("userType")String userType);
    /**
     * 获取用户成长明细
     */
    List<TIntegralInfo> getUserGrowth(CommonParam commonParam);

    /**
     * 获取所有权益
     */
    List<TMemberEquityEntity> getUserAllEquity(@Param("userType")String userType);


    /**
     *
     */
    String getUserLevelMinGrowthValue(@Param("levelNum") String levelNum,@Param("userType")String userType);


    /**
     * 获取用户积分明细
     */
    List<TIntegralInfo> getUserIntegral(CommonParam commonParam);

    /**
     * 获取用户即将过期积分
     */
    String getWillExpIntegral(@Param("userId") String userId,@Param("expDays")String expDays);

    /**
     * 积分预审单号
     * @param integralParam
     * @return
     */
    List<HashMap<String,String>> getIntegralBudgetNo(IntegralParam integralParam);

    /**
     *
     * @param taskType
     * @return
     */
    List<TTaskRuleEntity> getTaskRuleByType(@Param("taskType") String taskType, @Param("levelNum")String levelNum);
    List<TTaskRuleDoRecordEntity> selectTTaskRuleDoRecordByUserId(@Param("userId")String userId,
                                                                  @Param("type") String type);

    String selectTTaskRuleDoRecordByUserIdType(@Param("userId")String userId);

    /**
     *
     * @param budgetRequestNum
     * @return
     */
    void integralBudgetRelease(@Param("budgetRequestNum")String budgetRequestNum);

    void updateIntegralBudgetIntegralValue(@Param("budgetRequestNum") String budgetRequestNum,@Param("integralValue") String integralValue);

    /**
     *
     */
    List<String> selectMember();


    /**
     * 积分预算使用总数
     * @param integralParam
     */
    int getIntegralBudgetNoIntegral(IntegralParam integralParam);

    /**
     * 获取社区任务
     * @param
     * @return
     */
    TTaskComboEntity selectTaskCombo();

    /**
     *
     * @param integralParam
     * @return
     */
    int getIntegralBudgetNoTotalIntegral(IntegralParam integralParam);

    /**
     * 查询会员车主等级
     * @param integralParam 参数
     * @return 响应
     */
    List<TMemberEntity> selectMembersByLevel(IntegralParam integralParam);

    /**
     * 判断是否连续
     * @param taskRuleId
     * @return
     */
    List<TTaskRuleDoRecordEntity> selectContinuity(@Param("userId") String userId,@Param("taskRuleId") String taskRuleId);

}
